/****** Object:  Table [DW].[fACIAlerts]    Script Date: 29/04/2022 10:01:46 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[DW].[fACIAlerts]') AND type in (N'U'))
DROP TABLE [DW].[fACIAlerts]
GO

/****** Object:  Table [DW].[fACIAlerts]    Script Date: 29/04/2022 10:01:46 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [DW].[fACIAlerts](
	[Company] [int] NULL,
	[RowID] [bigint] NULL,
	[Entry No_] [int] NULL,
	[Alert Entry No_] [int] NULL,
	[Signal Date] [date] NULL,
	[Signal Time] [time](7) NULL,
	[AlertSeverity] [int] NULL,
	[AlertSeverityLabel] [nvarchar](30) NULL,
	[Code] [nvarchar](20) NULL,
	[NotificationSeverity] [int] NULL,
	[NotificationSeverityLabel] [nvarchar](30) NULL,
	[Impact Score] [int] NULL,
	[SK_KPICode] [int] NULL,
	[Item Category Code] [nvarchar](20) NULL,
	[Retail Product Code] [nvarchar](20) NULL,
	[Item No_] [nvarchar](20) NULL,
	[SK_Location] [int] NULL,
	[SK_POSTerminal] [int] NULL,
	[SK_Staff] [int] NULL,
	[SK_Vendor] [int] NULL,
	[SK_Customer] [int] NULL,
	[Alert Value Decimal] [decimal](38, 20) NULL,
	[Alert Value Boolean] [tinyint] NULL,
	[Alert Value Date] [datetime] NULL,
	[Alert Value Time] [datetime] NULL,
	[Alert Value Duration] [bigint] NULL,
	[Time to Review] [bigint] NULL,
	[Time to Close] [bigint] NULL,
	[Escalated] [tinyint] NULL,
	[Active User Group Code] [nvarchar](20) NULL,
	[Active User ID] [nvarchar](100) NULL,
	[NotificationStatus] [int] NULL,
	[NotificationStatusLabel] [nvarchar](30) NULL,
	[Calc_ Rule Code] [nvarchar](20) NULL
) ON [PRIMARY]
GO


/****** Object:  Table [DW].[fACISignals]    Script Date: 29/04/2022 10:08:26 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[DW].[fACISignals]') AND type in (N'U'))
DROP TABLE [DW].[fACISignals]
GO

/****** Object:  Table [DW].[fACISignals]    Script Date: 29/04/2022 10:08:26 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [DW].[fACISignals](
	[Company] [int] NULL,
	[SK_KPICode] [int] NULL,
	[SK_Location] [int] NULL,
	[SK_POSTerminal] [int] NULL,
	[SK_Staff] [int] NULL,
	[SK_Vendor] [int] NULL,
	[SK_Customer] [int] NULL,
	[RowID] [bigint] NULL,
	[Signal Date] [datetime] NULL,
	[Signal Time] [datetime] NULL,
	[Entry No_] [int] NULL,
	[Deleted] [tinyint] NULL,
	[Add_ Dimension 1] [nvarchar](20) NULL,
	[Add_ Dimension 2] [nvarchar](20) NULL,
	[Add_ Dimension 3] [nvarchar](20) NULL,
	[Add_ Dimension 4] [nvarchar](20) NULL,
	[Add_ Dimension 5] [nvarchar](20) NULL,
	[KPI Value Decimal 1] [decimal](38, 20) NULL,
	[KPI Value Decimal 2] [decimal](38, 20) NULL,
	[KPI Value Decimal 3] [decimal](38, 20) NULL,
	[KPI Value Decimal 4] [decimal](38, 20) NULL,
	[KPI Value Decimal 5] [decimal](38, 20) NULL,
	[KPI Value Boolean 1] [tinyint] NULL,
	[KPI Value Boolean 2] [tinyint] NULL,
	[KPI Value Boolean 3] [tinyint] NULL,
	[KPI Value Date 1] [datetime] NULL,
	[KPI Value Date 2] [datetime] NULL,
	[KPI Value Time 1] [datetime] NULL,
	[KPI Value Time 2] [datetime] NULL,
	[KPI Value Duration 1] [bigint] NULL,
	[KPI Value Duration 2] [bigint] NULL
) ON [PRIMARY]
GO
